#include <string>
#include <stdio.h>
#include <map>
#include <stdlib.h>
#include <iostream>
#include <string>
using namespace std;

map<string,int> word;
map<string,int>::iterator pos;
int num;

char ins[70];
string tmp;
int n;


int main()
{
    int len, site, i, j;
    int first=1;
    
    
    while(scanf("%d",&n)==1)
    {
        if (n==0) break;
        while (1)
        {
            scanf("%[^a-zA-Z]",ins);//read in characters NOT alpha
            scanf("%[a-zA-Z]",ins); //read in alpha characters
            if (strcmp(ins,"EndOfText")==0) break;
             
             for(i=0;i<strlen(ins);i++)
			{
				ins[i]=tolower(ins[i]);
			}
			tmp = ins;
            word[tmp] ++;

        }    
            
       

        if (first) first=0;
        else cout << endl;
      
        j = 0;
        for (pos=word.begin(); pos!=word.end(); ++pos)
        	if (pos->second == n)
        	{
          		cout << pos->first << endl;
          		j = 1;
            }  		
        if (j == 0) cout <<"There is no such word." << endl; 
      
       	word.clear(); 		
    }    
	    
    
    return 0;
}    
